package xy.pubsub.conf;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.listener.ChannelTopic;

@Configuration
public class PubConfig {

    @Value("${topic}")
    String topic;

    /**
     * 订阅发布的主题
     * @return
     */
    @Bean
    ChannelTopic topic() {
        return new ChannelTopic(topic);
    }
}
